package li;
import java.util.Date;

public class demo11 extends Thread{
	int sleepTime;
	String name;
	int counter;
	public demo11(int x,String n){
		sleepTime=x;
		name=n;
		counter=0;
	}
	public void run(){
	while(counter<10){
		try{
			counter++;
			System.out.println(name+":"+new Date(System.currentTimeMillis()));
			Thread.sleep(sleepTime);
		}catch(InterruptedException e){
			System.out.println(e);
			
		}
		
	}	
		
	}
	
	public static void main(String args[]){
		demo11 tp1=new demo11(1000, "Fast Thread");
		tp1.start();
		demo11 tp2=new demo11(3000, "Slow thread");
		tp2.start();	
	}

}
